package online.sanen.mhdt;

import ch.qos.logback.core.net.SyslogOutputStream;
import com.sun.org.apache.xpath.internal.SourceTree;
import online.sanen.mhdt.entity.AttrPoint;
import online.sanen.mhdt.entity.Hero;
import online.sanen.mhdt.entity.HeroAttr;
import online.sanen.mhdt.entity.HeroEquip;
import online.sanen.mhdt.entity.equip.test.*;

import java.util.Scanner;

public class main {
    static Hero hero=new Hero();
    public static void main(String[] arr){
        hero.setLevel(5);
        AttrPoint attrPoint = new AttrPoint(hero);
        attrPoint.countAllotPoint();
        hero.setAttrPoint(attrPoint);
        HeroEquip heroEquip = new HeroEquip(hero);
        xinshoubumao bumao=new xinshoubumao();
        xinshoubuxie buxie=new xinshoubuxie();
        xinshoubuyi buyi=new xinshoubuyi();
        xinshouwuqi wuqi=new xinshouwuqi();
        xinshouxianlian xianglian=new xinshouxianlian();
        xinshouyaodai yaodai=new xinshouyaodai();
        bumao.auth();
        buxie.auth();
        buyi.auth();
        wuqi.auth();
        xianglian.auth();
        yaodai.auth();
        heroEquip.setWeapon(wuqi);
        heroEquip.setCap(bumao);
        heroEquip.setBelt(yaodai);
        heroEquip.setShoe(buxie);
        heroEquip.setNecklace(xianglian);
        heroEquip.setClothes(buyi);
        heroEquip.reflushAttrList();
        hero.setHeroEquip(heroEquip);
        hero.getAttrPoint().countAttr();
        attr();
        System.out.println(heroEquip);
        while (true){
            Scanner in=new Scanner(System.in);
            int a=in.nextInt();
            switch (a){
                case 1:
                    hero.getAttrPoint().increaseStrTemp();
                    break;
                case 2:
                    hero.getAttrPoint().increaseMagTemp();
                    break;
                case 3:
                    hero.getAttrPoint().increaseConTemp();
                    break;
                case 4:
                    hero.getAttrPoint().increaseVitTemp();
                    break;
                case 5:
                    hero.getAttrPoint().increaseAgiTemp();
                    break;
            }
            attr();
        }
    }
    private  static void attr(){
        HeroAttr attr=hero.getHeroAttr();
        attr.refreshAttr();
        System.out.print("HP:"+attr.getHp()+"\t");
        System.out.print("MP:"+attr.getMp()+"\t");
        System.out.println("AD:"+attr.getAd());
        System.out.print("AP:"+attr.getAp()+"\t");
        System.out.print("DEF:"+attr.getDef()+"\t");
        System.out.println("MAGDEF:"+attr.getMagDef());
        System.out.print("SP:"+attr.getSp()+"\t");
        System.out.print("STR:"+attr.getStr()+"\t");
        System.out.println("MAG:"+attr.getMag());
        System.out.print("CON:"+attr.getCon()+"\t");
        System.out.print("VIT:"+attr.getVit()+"\t");
        System.out.println("AGI:"+attr.getAgi());
        System.out.println("point:"+hero.getAttrPoint().getAllotPoint());
    }
}
